package com.wl.common;

/**
 * 基于ThreadLocal封装工具类，用于保存和存于当前登录用户id
 * @创建人 万磊
 * @创建时间 2022/8/11
 * 好好学习，天天向上
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(Long empId){
        return threadLocal.get();
    }
}
